<template>
  <div class="tableShopBox" id="tableShopBox"><!--表格 商品信息组件-->
     	<div class="goodsBox" style="margin-bottom:10px" >
	      <div class="img">
	        <el-image :src="goodsInfo.goodsImage" fit="fill" v-image-preview="goodsInfo.goodsImage"></el-image>
	      </div>
	      <div class="goodsRight">
	        <div class="goodsName color-444 ellipsis-item font-size-13" style="margin:7px 0 8px 0">{{goodsInfo.goodsName}}</div>
	        <div class="goodsLabel d-flex">
	          <div class="color-999 d-flex margin-right-10 font-size-13">单价:{{goodsInfo.skuStockList[0].salePrice}}</div>
	          <div class="color-999 d-flex margin-right-10 font-size-13">数量:{{goodsInfo.goodsNum?goodsInfo.goodsNum:'1'}}</div>
	          <!-- <div class="color-999 d-flex font-size-13" v-if="goodsInfo.skuName">规格:{{goodsInfo.skuName}}</div> -->
	        </div>
	      </div>
	      <!-- <div class="shopMore" v-if="isMore && index=='0'" @click="handleOpen">更多 <i :class="open?'el-icon-arrow-up':'el-icon-arrow-down'" style="color: #61997A;"></i></div> -->
	    </div>
  </div>



</template>z

<script>
 export default {
   name: "tableShopBox",
   props: ['row'],
   data(){
     return{
     	isMore:false,
     	open:false,
      goodsInfo:{}
     }
   },
   watch:{
    row: function(value) {
      //this.isMore = (this.row.length>1)?true:false;
      this.goodsInfo = JSON.parse(this.row);
      console.log(this.goodsInfo)
    },
   },
   mounted() {
   		if(this.row){
   			//this.isMore = (this.row.length>1)?true:false;
        this.goodsInfo = JSON.parse(this.row)
        console.log(this.goodsInfo)
   		}
   },
   methods:{
		handleOpen(){
			this.open = !this.open;
      this.$nextTick(()=>{
        let height = Number(($('#tableShopBox'+this.index).css('height')).replace('px',''))+30;
        $('.el-table__fixed-body-wrapper tr').eq(this.index*2+1).css('height',height+'px');
      })
		}
   }
 }
</script>

<style lang="scss" scoped>
    .shopMore{
      cursor: pointer;
      display: flex;
      align-items: center;
      margin-left:10px;
      color: #61997A;
    }
</style>
